package com.doubao.user.feign;

import com.doubao.common.result.Result;
import com.doubao.user.dto.response.UserInfoResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "doubao-user", path = "/user")
public interface UserFeignClient {


    @GetMapping("/info/{userId}")
    Result<UserInfoResponse> getUserInfo(@PathVariable("userId") Long userId);

    @PostMapping("/wechat/bind")
    Result<Void> bindUserWechatInfo(
            @RequestParam("userId") Long userId,
            @RequestParam("openid") String openid,
            @RequestParam("unionid") String unionid
    );

}